﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SampleShop
{
    public abstract class AbstractMerchant:AbstractUser
    {
        /// <summary>
        /// 商铺内的商品
        /// </summary>
        private IList<IProduct> myProducts = new List<IProduct>();
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="product"></param>
        public  void AddProduct(IProduct product)
        {
            myProducts.Add(product);
            Console.WriteLine($"商户{UserName}添加了商品{product.Name}");
        }

        /// <summary>
        /// 修改商品
        /// </summary>
        /// <param name="product"></param>
        public  void EditProduct(IProduct product, decimal price)
        {
            if (price != product.Price)
                Console.WriteLine($"商品{product.Name}价格被修改成了{price}元");
            product.Price = price;
        }

        public override void ShowMyProducts()
        {
            Console.WriteLine("我的店铺里有以下商品：");
            base.ShowProducts();
        }
    }
}
